<?php
	$con = mysqli_connect("localhost","root","","movie");
	if(!$con)
		die("Could not connect" . mysql_error());

	$sql = "INSERT INTO user (name,telephone,address,email,password)
					   VALUES ('$_POST[name]','$_POST[telephone]','$_POST[address]','$_POST[email]','$_POST[password]')";
    
    if(mysqli_query($con,$sql)) {
       	echo "Register successfully!<br>";
        echo "Please log in on the main page!<br>";
        echo "Will direct you to main page in 4 seconds later...";	
    }
    else echo "Error! Please try to register again!";
    
    echo "<Meta http-equiv='Refresh' Content='4; Url=index.php'>";
?>